<?php

/*require_once 'data/lyrics.php';

$strs = explode("\r", $lyrics);
//$values = array();
echo "<h1>Until You</h1><br>";
for($i=0;$i<count($strs);$i++)
{
    if ($strs[$i] == "\n") {
        $strs[$i] = "<br>";
        $line = true;
        $count = $i;
        while ($line == true) {
            $count++;
            if ($strs[$count] == "\n") {
                $co = true;
                $strs[$count]="";
            } else {
                $line = false;
            }
        }
    }
    if($strs[$i]!="")
    {
       echo ucwords ($strs[$i]."<br>");
    }

}*/
require_once 'data/users.php';
//Logined user
if(isset($_POST["commit"]))
{
    $co = false;
    for ($i = 0; $i < count($users); $i++) {
        if (strcmp($_POST["login"], $users[$i]["username"]) == 0 && strcmp($_POST["password"], $users[$i]["password"]) == 0) {
            $co = true;
            break;
        } else {
            $co = false;
        }
    }
    if ($co == true)
        echo $_POST["login"] . " thành công";
    else
        echo $_POST["login"] . " Không thành công";
}
